package leetcode.字符串;

import java.util.Objects;

public class 找不同389 {
    public char findTheDifference(String s, String t) {
        if(Objects.equals(s, ""))
            return t.charAt(0);
        char res=s.charAt(0);
        for (int i = 1; i < s.length(); i++) {
            res = (char) (res ^ s.charAt(i));
        }
        for(char c:t.toCharArray())
            res = (char) (res ^c);

        return res;

    }
}
